package com.pretty.common;

import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.config.server.EnableConfigServer;
import org.springframework.context.ConfigurableApplicationContext;

@SpringBootApplication
@EnableDiscoveryClient
@EnableConfigServer
public class CloudConfig {
    private static ConfigurableApplicationContext applicationContext;

    public static void main(String[] args) {
        CloudConfig.applicationContext = new SpringApplicationBuilder(CloudConfig.class).web(true).run(args);
    }

    public static ConfigurableApplicationContext getApplicationContext() {
        return applicationContext;
    }
}
